#include<iostream>
#include<algorithm>

using namespace std;

const int INF=1919810114;

int main()
{
	int n;
	cin>>n;
	int sumf=0;
	int sums=0;
	int minf=INF;
	int mins=INF;
	int x,y;
	for(int i=1,x,y;i<=n;i++)
	{
		cin>>x>>y;
		sumf+=x;
		sums+=y;
		minf=min(minf,y);
		mins=min(mins,x);
	}
	cout<<max(sumf+minf,sums+mins)+1;
	return 0;
}